﻿# -*- codeing = utf-8 -*-
# @Time: 2021/10/15 18:54
# @Author: Ivan
# @File: 15-递归.py
# @Software: PyCharm

def sum(num):
    # 递归出口
    if num == 1:
        return 1
    # 求和
    return num + sum(num - 1)

print(sum(10))